<template>
  <div>
    <div class="article-container">
  <div class="breadcrumbs">
    <a href="/">首页</a> / <span>正文</span>
  </div>
  <h1 class="article-title">{{tableData.title}}</h1>
  <div class="article-meta">
    <span>发表于 {{tableData.updateTime}}</span>
    <span>分类于 {{tableData.categoryName}}</span>
    <span>阅读量 {{tableData.readNum}}</span>
  </div>
  <div class="article-content">
     
  </div>
  <div class="article-tag" v-html="tableData.content">
    
  </div>
  <hr>
  <div class="next-article">
    <a href="#">下一篇 > 11</a>
  </div>
</div>
  </div>
</template>

<script>
export default {
 created() {
    this.id = this.$route.query.id;
    this.getList();
    
  },
  data(){
    return{
      id:"",
      tableData:[],
    }
  },
  
   
  methods:{
          getList() {
      this.$axios
        .post(`/api/api/article/detail`,{
         articleId:this.id
        }
          )
        .then((res) => {
          this.tableData = res.data.data;
          console.log(this.tableData, "1111");
          console.log(res);
        })
        .catch((err) => {
          console.log(err);
        });
    },
  },
 
}
</script>

<style scoped>
.article-container {
  width: 80%;
  margin: 0 auto;
  padding: 20px;
  border: 1px solid #eee;
  border-radius: 5px;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}
.breadcrumbs {
  margin-bottom: 15px;
}
.breadcrumbs a {
  text-decoration: none;
  color: #333;
}
.article-title {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 10px;
}
.article-meta {
  color: #666;
  margin-bottom: 15px;
}
.article-meta span {
  margin-right: 15px;
}
.article-content {
  margin-bottom: 15px;
}
.article-tag span {
  display: inline-block;
  padding: 5px 10px;
  background-color: #e6f7ed;
  border-radius: 15px;
  color: #000;
}
.next-article {
  text-align: right;
  margin-top: 20px;
}
.next-article a {
  text-decoration: none;
  color: #333;
}

</style>